<!DOCTYPE html>
<html>
<head>
	<title>规格详情</title>
	<include file='public/head'>
	<style>
		.layui-legend-size{font-size:14px !important;}
		.layui-nopadding{padding:0 !important;}
		.layui-overflow{overflow:auto;}
		.layui-nomargin{margin: 0 !important;}
		.layui-bottom{border-bottom:1px solid rgb(226, 226, 226);}
		.layui-input{height:30px !important; }
		.layui-form-search-item .layui-inline{margin-bottom: 5px;} 
		.layui-form-search-item label{margin-left: 15px;}
		.layui-table-page {padding: 7px 0px 0px;}
		.layui-field-padding{border-width: 1px;padding:0 0 5px 10px;}
	</style>		
</head>
<body>
<div class="layui-tab" lay-filter="demo-tab">
	<form id="f" class="layui-form" action="" >
		<table  class="layui-table layui-nomargin" >
				<!-- 表格头 -->
				<thead>
					<tr>
						<th>商品sku</th>
						<th>规格</th>
						<th>规格图</th>
						<th>价格</th>
						<th>库存</th>
						<th>预警</th>
					</tr>
				</thead>
				<volist name="configs" id="vo">
					<tr>
						<td>{$vo.sku}</td>
						<td>{$vo.attr_name}</td>
						<td><img src="__ROOT__{$vo.img}" height="70"></td>
						<td>
							<input type="text" class="layui-input" name="price[]" value="{$vo.price}">
						</td>
						<td>
							<input type="text" class="layui-input" name="num[]" value="{$vo.num}">
						</td>
						<td>
							<input type="text" class="layui-input" name="limit[]" value="{$vo.limit}">
						</td>

						<input type="hidden" name="id[]" value="{$vo.id}">
					</tr>
				</volist>
			</table>
	</form>
</div>
<include file='public/scripts'>
</body>

<script type="text/javascript">

var tijiao = function(){
	let url = "{:cmf_plugin_url('Goods://goods_spec/saveGoodsSpec')}";
	let da = $('#f').serialize();
	$.ajax({
		url:url,
		data: da,
		type:'post',
		success:function(data){
			if (data.code == 1) {
				layer.msg(data.msg,{icon:1,time:1500},function(){
					parent.layer.closeAll();
					parent.location.reload(); 
				});
			} else {
				layer.msg(data.msg,{icon:2,time:1500});
			}
		},
		error:function()
		{
			layer.msg('系统错误',{icon:2,time:1500});
		}
	})
}

</script>

</html>